﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PegasCompany.Data;
using PegasCompany.Tools;
using Resources;

namespace PegasCompany
{
    public partial class About : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = String.Format("{0} - {1}", UserSite.resCompanyName, UserSite.resAbout);

            if (!Page.IsPostBack)
            {
                //List<SiteMenuItem> sm = SiteMenuItem.GetMenuItems(Request.FilePath);
                //if (sm != null)
                //{
                //    rptSubMenu.DataSource = sm;
                //    rptSubMenu.DataBind();
                //}

                List<SiteContent> sc = SiteContent.ListAllContent((int)EnumHelper.ContentType.About);
                if (sc != null && sc.Count > 0)
                {
                    SiteContent targetSiteContent = sc.SingleOrDefault();
                    if (targetSiteContent != null)
                    {
                        lContentTitle.Text = targetSiteContent.Title;
                        lContentDescription.Text = targetSiteContent.Description;

                        lContent.Text = targetSiteContent.Content;
                    }
                }
            }
        }
    }
}